<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateGoodsTable extends Migration
{

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods', function (Blueprint $table) {
            $table->increments('id');
            $table->string('sn', 32)->nullable();
            $table->string('name', 32)->nullable();
            $table->integer('click_count')->default(0);
            $table->integer('sales_count')->default(0);
            $table->string('brand', 32)->nullable();
            $table->string('provider_name', 32)->nullable();
            $table->integer('number')->default(0);
            $table->decimal('market_price', 10, 2)->default(0);
            $table->decimal('sale_price', 10, 2)->default(0);
            $table->string('unit', 32)->nullable();
            $table->timestamp('sale_start_date')->nullable();
            $table->timestamp('sale_end_date')->nullable();
            $table->integer('is_on_sale')->default(1);
            $table->integer('is_best')->default(0);
            $table->integer('is_new')->default(0);
            $table->integer('is_hot')->default(0);
            $table->integer('sort')->default(100);
            $table->text('desc')->nullable();
            $table->text('image', 191);
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('goods');
    }
}
